package org.usfirst.frc.team4716.robot;

import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.buttons.Button;
import edu.wpi.first.wpilibj.buttons.JoystickButton;

import org.usfirst.frc.team4716.robot.commands.BasketMoveForward;
import org.usfirst.frc.team4716.robot.commands.BasketMoveReverse;
import org.usfirst.frc.team4716.robot.commands.ElevatorDown;
import org.usfirst.frc.team4716.robot.commands.ElevatorLiftProcess;
import org.usfirst.frc.team4716.robot.commands.ElevatorUp;
import org.usfirst.frc.team4716.robot.commands.ExampleCommand;
import org.usfirst.frc.team4716.robot.commands.MoveMotor;
import org.usfirst.frc.team4716.robot.commands.MoveMotorBack;

/**
 * This class is the glue that binds the controls on the physical operator
 * interface to the commands and command groups that allow control of the robot.
 */
public class OI {
	
	Joystick stick = new Joystick(0);
	
	JoystickButton but1 = new JoystickButton(stick, 1);
	JoystickButton but2 = new JoystickButton(stick, 2);
	JoystickButton but3 = new JoystickButton(stick, 3);
	JoystickButton but4 = new JoystickButton(stick, 4);
	JoystickButton but5 = new JoystickButton(stick, 5);
	JoystickButton but6 = new JoystickButton(stick, 6);
	JoystickButton but7 = new JoystickButton(stick, 7);
	
	public OI(){
		but1.whenPressed(new ElevatorLiftProcess());
		but2.whenPressed(new BasketMoveForward());
		but3.whenPressed(new BasketMoveReverse());
		but4.whenPressed(new ElevatorUp());
		but5.whenPressed(new ElevatorDown());
		but6.whenPressed(new MoveMotor());
		but7.whenPressed(new MoveMotorBack());
		
		
	}
	
	public double joystickGetY(){
		return stick.getY();
	}
    //// CREATING BUTTONS
    // One type of button is a joystick button which is any button on a joystick.
    // You create one by telling it which joystick it's on and which button
    // number it is.
    // Joystick stick = new Joystick(port);
    // Button button = new JoystickButton(stick, buttonNumber);
    
    // There are a few additional built in buttons you can use. Additionally,
    // by subclassing Button you can create custom triggers and bind those to
    // commands the same as any other Button.
    
    //// TRIGGERING COMMANDS WITH BUTTONS
    // Once you have a button, it's trivial to bind it to a button in one of
    // three ways:
    
    // Start the command when the button is pressed and let it run the command
    // until it is finished as determined by it's isFinished method.
    // button.whenPressed(new ExampleCommand());
    
    // Run the command while the button is being held down and interrupt it once
    // the button is released.
    // button.whileHeld(new ExampleCommand());
    
    // Start the command when the button is released  and let it run the command
    // until it is finished as determined by it's isFinished method.
    // button.whenReleased(new ExampleCommand());
}

